K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
InfoPath - Invalid date error in Data Event wizard

Issue:


When using a suggested "Format DateTime - Inline function" with a K2 Date field and the "yyyy-MM-dd" format as a parameters for a mapping source, and an InfoPath "Date" XML node as the destination, the mapping during runtime resolves the source value correctly for example,"2010-07-20" but casts the value to a DateTime object which then adds a TimeSpan to the already correct Date value resulting in "2010-07-20 12:00:00 AM". This is not expected in the InfoPath schema for the Node , which causes InfoPath to raise an error on opening stating that the "value is not a valid date".

The destination value type can be determined as the InfoPath schema for the node is available when the mapping is being authored, this will allow the Data Mapper to determine whether the source value should be used as a string or as a datetime object during runtime.

Workaround:

  1. Copy the code from the file PerformMappings by right clicking then go to definition on “PerformMappings()”.
  2. Paste it into a new Server Event.
  3. Alter the code not to do the date conversions.

 

 


K2 blackpearl Help 4.6.10 (4.12060.1690.0)